﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;

namespace YJKSparseDistance.ModelLayer
{
	public class BaseCurveBean
	{
		public virtual List<BulidingCurvePakcer> LstCurvePacker
		{
			get
			{
				return this.m_lstCurvePacker;
			}
		}

		public virtual List<XYZ> LstAllFreeEnd
		{
			get
			{
				return this.m_lstAllFreeEnd;
			}
		}

		protected List<XYZ> GetFreeCurveFreeEnd(List<BulidingCurvePakcer> inputValue)
		{
			XYZCompare compare = XYZCompare.GetCompare();
			compare.Reset();
			List<XYZ> list = new List<XYZ>();
			foreach (BulidingCurvePakcer bulidingCurvePakcer in from n in inputValue
			where n.IfFreeEnd && !n.IfDoorFreeEnd
			select n)
			{
				for (int i = 0; i < 2; i++)
				{
					list.Add(bulidingCurvePakcer.ThisCurve.GetEndPoint(i));
				}
			}
			list = list.Distinct(compare).ToList<XYZ>();
			compare.Reset();
			return list;
		}

		protected List<BulidingCurvePakcer> m_lstCurvePacker = new List<BulidingCurvePakcer>();

		protected List<XYZ> m_lstAllFreeEnd = new List<XYZ>();
	}
}
